package com.javachamp.collections;

import java.util.Map;
import java.util.TreeMap;

public class MapDemo {

	static Map<Integer, String> map = new TreeMap<Integer, String>();
	
	static {
		map.put(1, "a");
		map.put(3, "c");
		map.put(2, "b");
		map.put(7, "g");
		map.put(4, "d");
		map.put(9, "j");
		map.put(8, "h");
		map.put(5, "e");
		map.put(6, "f");
	}
	
	public static void main(String[] args) {
		System.out.println(map.size());
		System.out.println(map.containsKey(6));
		System.out.println(map.containsValue("f"));
		System.out.println(map.get(6));
		System.out.println(map.isEmpty());
		System.out.println(map.entrySet());
		System.out.println(map.keySet());
		System.out.println(map.values());
		
		map.put(6, "x");
		
		System.out.println(map.size());
		System.out.println(map.containsKey(6));
		System.out.println(map.containsValue("f"));
		System.out.println(map.get(6));
		System.out.println(map.isEmpty());
		System.out.println(map.entrySet());
		System.out.println(map.keySet());
		System.out.println(map.values());
		
	}
	
}
